Introduce UTF Analyzers and resolve diagnostics - #45
Merged
Merged
Conversation
Upgrading UTF Analyzers surfaced errors that block compilation and warnings that bury real findings in this example project. - Add Timeout attributes so that condition waits fail fast instead of running for the 180-second default - Restrict Has.Length/Has.Property tests to the Editor, since link.xml no longer preserves the looked-up properties on the Player - Suppress, with reasons, diagnostics on code that intentionally demonstrates unsupported or discouraged patterns - Demote UTF4004-UTF4007 to suggestion, since fixed-time waits and coroutine-style tests are what many of these examples demonstrate - Fix redundant code reported by ReSharper inspections Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Code Metrics Report
Details | | master (0ec88ab) | #45 (b87466b) | +/- |
|---------------------|------------------|---------------|-------|
- | Coverage | 39.3% | 39.0% | -0.3% |
| Files | 25 | 25 | 0 |
| Lines | 478 | 476 | -2 |
- | Covered | 188 | 186 | -2 |
+ | Code to Test Ratio | 1:4.0 | 1:4.0 | +0.0 |
| Code | 1255 | 1256 | +1 |
+ | Test | 5071 | 5087 | +16 |
- | Test Execution Time | 6m16s | 6m27s | +11s |Code coverage of files in pull request scope (4.5% → 2.8%, patch 0.0%)
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nunit.analyzersNuGet package with the UTF Analyzers package (com.nowsprinting.test-framework.analyzers) v1.4.2, which bundles NUnit.Analyzers plus Unity Test Framework-specific rulesAssets/Changes
Packages / analyzer configuration
nunit.analyzersNuGet packageDefault.globalconfigUTF2006(property lookup removable by managed code stripping) as warning, and removelink.xmlUTF4004–UTF4007to suggestion, since fixed-time waits and coroutine-style ([UnityTest]/[UnitySetUp]) tests are exactly what many examples demonstrateFixes
UTF4001: Add[Timeout]so condition waits fail fast instead of running for the 180-second default (UnityTestFrameworkVersionCheck,LogAssertExample, InputSystemScenarioTest)UTF2006: RestrictHas.Length/Has.Propertyexamples inConstraintExampleto the Editor with[UnityPlatform], sincelink.xmlno longer preserves the properties on the Playerusing, unused locals, and the unusedUsingEventTriggerTest.GetScreenPointSuppressions (each with a reason comment)
UTF2001/UTF2002/UTF2003:[Ignore]/[Explicit]examples showing unsupported async usageUTF2005:DelayedConstraintexample;realtimeSinceStartupadvances within the same frameUTF4003: busy-wait loops inTimeoutAttributeExample/MaxTimeAttributeExamplethat intentionally exceed the time limitHeuristicUnreachableCode(LogAssertExample, driven by theFailconstant),Unity.UnknownResource(ResourcesExample, resources generated byIPrebuildSetup),CompareOfFloatsByEqualityOperator(NSubstituteJankenTest, exact literal argument check)🤖 Generated with Claude Code